//
//	(c) 2009 Andrew Kalmacky
//
#include "ltm_string.h"

using namespace ak::string;

void ConstCharBuffer::delete_this()
{
    if (_can_be_deleted())
    {
        this->~ConstCharBuffer();
        delete[] reinterpret_cast<char*>(this);
    }
}

pin<ConstCharBuffer> ConstCharBuffer::make(size_t size)
{
    if (!size)
        return get_null();
        return new (new char[sizeof(ConstCharBuffer) + sizeof(char_t) * size]) ConstCharBuffer(size);
}

pin<ConstCharBuffer> ConstCharBuffer::get_null()
{
    static pin<ConstCharBuffer> null_string = new ConstCharBuffer(0);
    return null_string;
}

